<?php
use frontend\assets\AppAsset;
use yii\helpers\Url;

AppAsset::register($this);

$this->title = $main_list['brand_name'].' '.$main_list['goods_name_cn'].' | 剪刀商城';
$this->params['breadcrumbs'][] = $this->title;
$image_bath_url = Yii::$app->params['static'];

$this->registerMetaTag(["name"=>"keywords","content"=> empty($main_list['seo_keywords']) ? SEO_KEYWORDS : $main_list['seo_keywords']]);
$this->registerMetaTag(["name"=>"description","content"=>empty($main_list['seo_description']) ? SEO_DESCRIPTION : $main_list['seo_description']]);


?>
<?php
AppAsset::addCss($this,$image_bath_url . "/static/pc/css/common/font-awesome-4.7.0/css/font-awesome.min.css");
AppAsset::addCss($this,$image_bath_url . "/static/common/video-js.css");
AppAsset::addCss($this,$image_bath_url . "/static/pc/css/common/prouduct-list.css");
AppAsset::addCss($this,$image_bath_url . "/static/pc/css/user-center/user-center-yhj.css");
AppAsset::addCss($this,$image_bath_url . "/static/pc/css/detail.css");
AppAsset::addCss($this,$image_bath_url . "/static/common/jqueryzoom.css");
?>
    <article>
    <div class="w br4 mt50"></div>
    <section class="content mt40 w">
    <!-- 路径 -->
    <?= \frontend\widget\DetailCrumbWidget::widget() ?>
    <!-- 路径End -->
    <!-- 商品信息 -->
    <div class="detail_info mt20">
        <!-- 商品左侧图片 -->
        <div class="detail_info_left fl">
            <div class="left_img_big pr">
                <div class="img mid item">
                    <div class="item_img_show">
                        <!-- 大图显示  -->
                    </div>
                        <span class="js_video_box hide">
                             <!-- video显示  -->
                        </span>
                </div>
                <span class="icon mid js_icon"></span>

            </div>
            <ul class="left_img_tab mt20">
              <!--小图显示-->
            </ul>
        </div>

        <!-- 商品左侧图片End -->
        <!-- 商品右侧SKU -->
        <div class="detail_info_right fr">
            <?php if($main_list['country_icon']){?>
            <p class="detail_brand">
                <span class="icon" style="vertical-align: inherit;margin-right: 0px;">
                  		<!--国家国旗-->
						<?php if($main_list['country_icon']):?>
                        <img class="narrow_img" src="<?=$image_bath_url.'/'.$main_list['country_icon']?>" alt=""/>
						<?php endif;?>
                </span>
				<!--商品产地-->
				<?=$main_list['country_name']?>
			</p>
            <?php }?>
            <h2 class="h2">
				<!--品牌名称-->
				<?=$main_list['brand_name']?>
            </h2>
			<h5 class="h5">
				<?=$main_list['goods_name_cn']?>
				<span class="detail_info_series">
					<?php if(!empty($main_list['series'])){?><?=$main_list['series']?><?php }?>
				</span>
			</h5>


			<p class="detail_info_num">
				商品编号:<span><?=$main_list['sku']?></span>
			</p>
            <!-- 没有促销信息的情况下添加detail_price_2 ,cx_info添加hide-->
            <div class="detail_price mt30 detail_price_2">
                <p class="price_info">
                    <label>售价:</label>
                    <span class="price pl10 p_1"><?=($main_list['hidden_price'] == '1' ? '' : $main_list['unit'])?>
                        <span><?=number_format($main_list['sale_price'],0)?></span>
                        <del><?=$main_list['unit']?></del><del style="margin-left: 0.3rem;"><?=number_format($main_list['market_price'],0)?></del>
                    </span>
                <!-- <span class="price pl10 p_2"><?/*=$main_list['unit']*/?> <span>
                            <?/*=number_format($main_list['min_price'],0)*/?></span>-<span>
                            <?/*=number_format($main_list['max_price'],0)*/?></span><del>CNY<?/*=number_format($main_list['market_price'],0)*/?></del></span>-->
                </p>
                <div class="cx_info">
                    <label class="fl">促销:</label>
                    <select class="price pl10 fr" id="sale_info">
                    </select>
                </div>
            </div>
            <div class="detail_style mt30">
                <label class="fl">规格:</label>
                <!-- 规格超过4个的情况下使用s-1,否则s-2 -->
                <div class="style_list d_l pl10 s-1 fr">
                    <select id="spece_max" class="item" onchange="appendSpec($(this).val(),0)">

                    </select>
                </div>
				<!--规格小于4个-->
                <ul id ="spece_min" class="style_list style_list_2 d_l pl10 s-2 fr">

                </ul>
            </div>

          	<!--颜色-->
            <div class="detail_color mt20 clear">
                <label class="fl">颜色:</label>
                <ul id="spec_color" class="color_list d_l pl10 fr">

                </ul>
            </div>


            <div class="btn-group clear">
                <button type="button" class="down_btn js_down get-coupon hide"><span class="icon icon-dowload"></span>领取优惠劵</button>
                <button type="button" class="into_btn js_inset_hart">
                	<span class="icon icon-hart <?=($main_list['is_collection'] == 1 ? 'icon-hart-active' : '')?>"></span>加入心愿单
                </button>
                <button type="button" class="fx_btn js_fx"><span class="icon icon-de-fx"></span>分享
                    <div class="wechat_fx_layer shadebox hide" >
                        <h2>扫描二维码</h2>
                        <!-- <img src="<?=$image_bath_url ?>/static/pc/image/iconPng/Bitmap.png" alt="wechat"/> -->
                        <img src="<?=$qrcode_url?>" alt="wechat"/>
                    </div>
                </button>
            </div>
        </div>
        <!-- 商品右侧SKU End-->
    </div>
    <!-- 商品信息End -->
    <div class="detail_info_about mt100">
    <div class="user-center-w">
    <ul class="info_title">
        <li class="d_l product_info_title"><a href="javascript:;">商品描述</a></li>
        <li class="d_l"><a href="#pr-2">品牌故事</a></li>
    </ul>
    <div class="detail_product_info">
        <?=$main_list['brief_cn']?>

    </div>
    <div class="detail_brand_info " id="pr-2">
        <h2>品牌故事</h2>
        <?php /* bug 处理 http://202.1.80.32/task-view-342.html
        if(!empty($main_list['logo'])){?>
        <h5 class="mt30 brand_logo">
            <img src="<?=$image_bath_url . '/' . $main_list['logo'] ?>" alt="<?=$main_list['brand_name']?>"/>
        </h5>
        <?php }*/?>
        <?=$main_list['brand_story'] ?>
    </div>

    <!-- 相关搭配 -->
        <?php if(!empty($group_goods_list)){?>
            <div class="match mt100">
                <h3 class="title">相关搭配</h3>
                <div class="proudct_list clear mt40">
                    <ul class="proudct_list_ul" id="group_goods_list">
                        <?php foreach($group_goods_list as $value){?>
                            <li class="item pr">
                                <div class="item_img">
									<!--mod by FDG367 461 点击商品图片、国家图标、品牌、商品名称、系列名、价格，都能链接至商品详情页 2018-01-24 start-->
                                    <?php if($value['is_collection'] == 1){?>
                                        <span class="icon icon_animation icon-hart-active" data-goods-id="<?=$value['goods_id']?>"></span>
                                    <?php }else{?>
                                        <span class="icon icon_animation icon-hart" data-goods-id="<?=$value['goods_id']?>"></span>
                                    <?php }?>
									<!--mod by FDG367 461 点击商品图片、国家图标、品牌、商品名称、系列名、价格，都能链接至商品详情页 2018-01-24 end-->
                                    <ul class="item_img_list">
                                        <li class="img_item"><a href="<?php echo \yii\helpers\Url::to(['/goods/goods-detail','goods_id'=>$value['main_goods_id']]);?>"><img src="<?= Yii::$app->params['static'] . '/' . $value['goods_main_pic'] ?>" title="<?=$value['goods_pic_title']?>" alt="<?=$value['goods_pic_alt']?>"></a></li>
                                    </ul>
                                </div>
                                <div class="item_info">
                                    <h4>
                                <span class="icon" style="vertical-align: inherit;">
                                    <?php if(!empty($value['brand_icon'])){?>
                                        <img style="width: 24px;" src="<?= Yii::$app->params['static'] . '/' . $value['brand_icon'] ?>" alt="<?=$value['brand_country_name']?>"/>
                                    <?php }else{?>
                                    <?php }?>
                                </span>
                                        <?=$value['brand_name'] ?>
                                    </h4>
                                    <p class="info"><span class="info_br"><?=$value['series'] ?></span> <?=$value['goods_name_cn'] ?></p>
                                    <p><del><?=$value['unit'].$value['market_price'] ?></del><span class="item_price"><?=$value['unit'].$value['sale_price'] ?></span></p>
                                </div>
                            </li>
                        <?php }?>
                    </ul>
                </div>
            </div>
        <?php }?>
    </div>
    </div>
    </section>
    </article>
    <!-- 优惠券领取 -->
	<div class="yhj_success_layer" id="yhj_layer">
        <div class="success_content mid">
            <span class="icon icon-close" id="yhj_close">X</span>
            <div class="title">
                <h2>优惠劵领取成功</h2>
            </div>
            <div class="user_yhj_list mt30">
                <ul class="user_yhj_item detail-yhj">
                </ul>
                <p style="text-align: center;margin-top: 1rem;" class="link-text yhj_phone">优惠券已放入账号：<a href="user_center_yhj.html" class="link link-text"><?=empty($memberInfo->mobile) ? '' : $memberInfo->mobile?></a></p>
            </div>
            <a href="/customer/coupon" target=_blank class="btn">点击查看<span class="icon arrow_icon"></span></a>
            <div class="yhj_footer">
                <p class="link-text">提示：1、请注意查收短信获取优惠券验证码；</p>
                <p class="link-text">2、优惠券需前往<a href="javascript:;" class="link">线下门店</a>兑换；</p>
            </div>
        </div>
    </div>
    <span class="main_goods_span"></span>

<?= \Yii::$app->view->renderFile('@app/views/common/back-top.php',
	[
		'product'=>[
			'title'	=>$main_list['goods_name_cn'],
			'url'	=>Yii::$app->request->hostInfo.Yii::$app->request->getUrl(),
			'image'	=>$image_bath_url . '/' . $main_list['goods_main_pic'],
			'物料号'	=>$main_list['sku'],
			'售价'	=>$main_list['unit'] . $main_list['sale_price'],
			'促销价'	=>$main_list['unit'] . $main_list['market_price']
		]
	]);?>
<?php
/*AppAsset::addJs($this,$image_bath_url."/static/common/xq_bigimg.js");*/
AppAsset::addJs($this,$image_bath_url."/static/common/jquery.zoom.js");
AppAsset::addJs($this,$image_bath_url."/static/pc/js/common/layerShow.js");
AppAsset::addJs($this,$image_bath_url."/static/common/video.min.js");
AppAsset::addJs($this,$image_bath_url."/static/pc/js/detail.js?version=".Yii::$app->params['version']);
?>
<script type="text/javascript">
    <?php $this->beginBlock('js') ?>
    var main_goods_id = "<?=$main_list['main_goods_id']?>";
    var main_spec_id = "<?=$main_list['spec']?>";
    var main_spec_color_id = "<?=$main_list['spec_color']?>";
    var bath_url = "<?= $image_bath_url?>";
    var videos = <?= $source_list?>;
    var image_bath_url = "<?=$image_bath_url?>";
    var coupon_class = <?=json_encode($GLOBALS['_COUPON_TYPE_CLASS'])?>;
    imgShow(videos);
    <?php $this->endBlock() ?>
    <?php $this->registerJs($this->blocks['js'], \yii\web\View::POS_END); ?>
</script>